package com.niiwoo.civet.trade.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.niiwoo.civet.trade.dao.entity.RefundNotifyRecord;

public interface RefundNotifyRecordMapperExt extends RefundNotifyRecordMapper {
	
	/**
	 * 批量插入
	 * 
	 * @param recordList
	 */
	void batchInsert(List<RefundNotifyRecord> recordList);
	
	/**
	 * 批量更新状态
	 * 
	 * @param refundNotifyIdList
	 * @param handleStatus
	 */
	void batchUpdateStatus(@Param("idList") List<Long> idList, @Param("handleStatus") Byte handleStatus);
	
	/**
	 * 根据批次号查询消息列表
	 * 
	 * @param batchNo
	 * @return
	 */
	List<RefundNotifyRecord> selectByBatchNo(@Param("batchNo") String batchNo);
	
	/**
	 * 查询需要处理的批次
	 * 
	 * @return
	 */
	List<String> selectNeedHandleBatchNoList();
	
	/**
	 * 统计需要处理的记录
	 * 
	 * @param status
	 * @return
	 */
	Integer countNeedHandleRefundNotify(@Param("status") byte status);
	
	/**
	 * 分页查询待处理的消息
	 * 
	 * @param status
	 * @param offset
	 * @param rows
	 * @return
	 */
	List<RefundNotifyRecord> selectNeedHandleRefundNotifyList(@Param("status") byte status, @Param("offset") Integer offset, @Param("rows") Integer rows);
	
	/**
	 * 根据条件查询唯一的记录
	 * 
	 * @param refundNotifyException
	 * @return
	 */
	RefundNotifyRecord selectUniqueByCriteria(RefundNotifyRecord refundNotifyException);
	
	/**
	 * 清除指定天数已处理的记录
	 * 
	 * @param exceedDay
	 */
	void deleteHandledRefundNotifyRecordByExceedDay(@Param("exceedDay") Integer exceedDay);	
}